inherited fmCommonOut: TfmCommonOut
  Left = 338
  Top = 208
  Width = 688
  Height = 862
  Anchors = [akLeft, akTop, akRight]
  BorderIcons = [biSystemMenu, biMinimize]
  Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075
  Constraints.MinWidth = 645
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 801
    Width = 680
  end
  inherited Panel1: TPanel
    Width = 680
    Height = 41
    inherited BitBtn1: TBitBtn
      Left = 510
    end
    inherited BitBtn2: TBitBtn
      Left = 598
      Top = 4
      Height = 29
    end
  end
  object GroupBox1: TGroupBox [2]
    Left = 0
    Top = 41
    Width = 680
    Height = 176
    Align = alTop
    TabOrder = 2
    object Label5: TLabel
      Left = 8
      Top = 102
      Width = 26
      Height = 13
      Caption = #1044#1072#1090#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label6: TLabel
      Left = 182
      Top = 110
      Width = 93
      Height = 13
      Caption = #1041#1072#1083#1072#1085#1089' '#1087#1086#1076#1086#1090#1095#1077#1090#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object rgDo: TcxRadioGroup
      Left = 8
      Top = 24
      Caption = #1044#1077#1081#1089#1090#1074#1080#1077
      Properties.Items = <
        item
          Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075' '#1074' '#1073#1072#1085#1082
          Value = 0
        end
        item
          Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075' '#1076#1088#1091#1075#1086#1084#1091' '#1083#1080#1094#1091
          Value = 1
        end
        item
          Caption = #1042#1086#1079#1074#1088#1072#1090' '#1088#1086#1076#1080#1090#1077#1083#1103#1084
          Value = 2
        end>
      Properties.OnChange = rgDoPropertiesChange
      TabOrder = 0
      Height = 73
      Width = 313
    end
    object cxDBDateEdit1: TcxDBDateEdit
      Left = 8
      Top = 119
      DataBinding.DataField = 'RPDATE'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.DateButtons = [btnClear, btnToday]
      Properties.InputKind = ikMask
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 1
      Width = 153
    end
    object eBalance: TcxTextEdit
      Left = 181
      Top = 125
      TabStop = False
      ParentFont = False
      Properties.Alignment.Horz = taRightJustify
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 2
      Width = 142
    end
  end
  object Panel2: TPanel [3]
    Left = 0
    Top = 217
    Width = 680
    Height = 264
    Align = alTop
    TabOrder = 3
    Visible = False
    object Label2: TLabel
      Left = 9
      Top = 1
      Width = 96
      Height = 13
      Align = alCustom
      Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxLookupComboBox1: TcxLookupComboBox
      Left = 8
      Top = 19
      ParentFont = False
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end>
      Properties.ListSource = dsPoluchUslug
      Properties.OnChange = cxLookupComboBox1PropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      OnClick = cxLookupComboBox1Click
      Width = 473
    end
    object dbgPeopleFind: TcxGrid
      Left = 9
      Top = 57
      Width = 624
      Height = 176
      Align = alCustom
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 1
      LookAndFeel.Kind = lfStandard
      object tvPeopleFind: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Enabled = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.CustomizeDialog = False
        FilterBox.Visible = fvNever
        DataController.DataSource = dsUsluga
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <
          item
            Format = '#,###0'
            Kind = skSum
            FieldName = 'DOSTUPNO'
            Column = tvPeopleFindDOSTUPNO
          end
          item
            Format = '#,###0'
            Kind = skSum
            FieldName = 'ZAPL'
            Column = tvPeopleFindZAPL
          end>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        OptionsBehavior.CellHints = True
        OptionsBehavior.FocusFirstCellOnNewRecord = True
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.Appending = True
        OptionsData.Deleting = False
        OptionsData.Inserting = False
        OptionsView.NavigatorOffset = 5
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.CellAutoHeight = True
        OptionsView.CellTextMaxLineCount = 2
        OptionsView.ColumnAutoWidth = True
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.HeaderEndEllipsis = True
        OptionsView.Indicator = True
        OptionsView.ShowColumnFilterButtons = sfbAlways
        Styles.Content = DMInv.cxData
        Styles.IncSearch = DMInv.cxGreenText
        Styles.Header = DMInv.cxSiniyText
        object tvPeopleFindSTNAME: TcxGridDBColumn
          Caption = #1059#1089#1083#1091#1075#1072
          DataBinding.FieldName = 'STNAME'
          Options.Editing = False
          Width = 411
        end
        object tvPeopleFindDOSTUPNO: TcxGridDBColumn
          Caption = #1044#1086#1089#1090#1091#1087#1085#1086
          DataBinding.FieldName = 'DOSTUPNO'
          Options.Editing = False
          Width = 106
        end
        object tvPeopleFindZAPL: TcxGridDBColumn
          Caption = #1057#1091#1084#1084#1072' '#1087#1077#1088#1077#1076#1072#1095#1080
          DataBinding.FieldName = 'ZAPL'
          PropertiesClassName = 'TcxCalcEditProperties'
          Properties.OnValidate = tvPeopleFindZAPLPropertiesValidate
          Styles.Content = DMInv.cxJoltiyFon
          Width = 91
        end
      end
      object dbgPeopleFindLevel1: TcxGridLevel
        GridView = tvPeopleFind
      end
    end
  end
  object Panel3: TPanel [4]
    Left = 0
    Top = 481
    Width = 680
    Height = 72
    Align = alTop
    TabOrder = 4
    Visible = False
    object Label7: TLabel
      Left = 8
      Top = 15
      Width = 95
      Height = 13
      Caption = #1055#1086#1076#1086#1090#1095#1077#1090#1085#1086#1077' '#1083#1080#1094#1086
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label4: TLabel
      Left = 324
      Top = 9
      Width = 60
      Height = 13
      Caption = #1057#1091#1084#1084#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxDBLookupComboBox2: TcxDBLookupComboBox
      Left = 8
      Top = 31
      DataBinding.DataField = 'PPID_TO'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'PPID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'FIO'
        end>
      Properties.ListSource = dsPodotchLitso
      Properties.MaxLength = 0
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      Width = 297
    end
    object edCSAMOUNT: TcxDBTextEdit
      Left = 321
      Top = 26
      DataBinding.DataField = 'RPSUMMA'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 1
      Width = 143
    end
  end
  object Panel4: TPanel [5]
    Left = 0
    Top = 553
    Width = 680
    Height = 128
    Align = alTop
    TabOrder = 5
    object Label14: TLabel
      Left = 9
      Top = 11
      Width = 67
      Height = 13
      Align = alCustom
      Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxDBMemo1: TcxDBMemo
      Left = 8
      Top = 32
      DataBinding.DataField = 'RPNOTE'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      Height = 89
      Width = 625
    end
  end
  object dsPC: TDataSource
    DataSet = qPC
    Left = 144
    Top = 381
  end
  object qPC: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT RP.*'
      'FROM RASPRED_PODOTCH RP'
      'WHERE RP.RPID = -1')
    UpdateObject = quPC
    GeneratorField.Field = 'RPID'
    GeneratorField.Generator = 'GEN_RASPRED_PODOTCH_ID'
    Left = 176
    Top = 381
    object qPCRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RASPRED_PODOTCH"."RPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPCRPDATE: TDateField
      FieldName = 'RPDATE'
      Origin = '"RASPRED_PODOTCH"."RPDATE"'
    end
    object qPCPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"RASPRED_PODOTCH"."PPID"'
    end
    object qPCRPSUMMA: TIBBCDField
      FieldName = 'RPSUMMA'
      Origin = '"RASPRED_PODOTCH"."RPSUMMA"'
      Precision = 18
      Size = 2
    end
    object qPCRPUSERENTER: TIBStringField
      FieldName = 'RPUSERENTER'
      Origin = '"RASPRED_PODOTCH"."RPUSERENTER"'
      Size = 40
    end
    object qPCRPTIMEENTER: TDateTimeField
      FieldName = 'RPTIMEENTER'
      Origin = '"RASPRED_PODOTCH"."RPTIMEENTER"'
    end
    object qPCRPUSEREDIT: TIBStringField
      FieldName = 'RPUSEREDIT'
      Origin = '"RASPRED_PODOTCH"."RPUSEREDIT"'
      Size = 40
    end
    object qPCRPTIMEEDIT: TDateTimeField
      FieldName = 'RPTIMEEDIT'
      Origin = '"RASPRED_PODOTCH"."RPTIMEEDIT"'
    end
    object qPCPPID_TO: TIntegerField
      FieldName = 'PPID_TO'
      Origin = '"RASPRED_PODOTCH"."PPID_TO"'
    end
    object qPCRPTYPE: TIntegerField
      FieldName = 'RPTYPE'
      Origin = '"RASPRED_PODOTCH"."RPTYPE"'
    end
    object qPCRPISDELETE: TIntegerField
      FieldName = 'RPISDELETE'
      Origin = '"RASPRED_PODOTCH"."RPISDELETE"'
    end
    object qPCCSID: TSmallintField
      FieldName = 'CSID'
      Origin = '"RASPRED_PODOTCH"."CSID"'
    end
    object qPCRPNOTE: TIBStringField
      FieldName = 'RPNOTE'
      Origin = '"RASPRED_PODOTCH"."RPNOTE"'
      Size = 255
    end
  end
  object quPC: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RPID,'
      '  RPDATE,'
      '  PPID,'
      '  RPSUMMA,'
      '  RPUSERENTER,'
      '  RPTIMEENTER,'
      '  RPUSEREDIT,'
      '  RPTIMEEDIT,'
      '  PPID_TO,'
      '  RPTYPE,'
      '  RPISDELETE,'
      '  CSID,'
      '  RPNOTE'
      'from RASPRED_PODOTCH '
      'where'
      '  RPID = :RPID')
    ModifySQL.Strings = (
      'update RASPRED_PODOTCH'
      'set'
      '  CSID = :CSID,'
      '  PPID = :PPID,'
      '  PPID_TO = :PPID_TO,'
      '  RPDATE = :RPDATE,'
      '  RPID = :RPID,'
      '  RPISDELETE = :RPISDELETE,'
      '  RPNOTE = :RPNOTE,'
      '  RPSUMMA = :RPSUMMA,'
      '  RPTIMEEDIT = :RPTIMEEDIT,'
      '  RPTIMEENTER = :RPTIMEENTER,'
      '  RPTYPE = :RPTYPE,'
      '  RPUSEREDIT = :RPUSEREDIT,'
      '  RPUSERENTER = :RPUSERENTER'
      'where'
      '  RPID = :OLD_RPID')
    InsertSQL.Strings = (
      'insert into RASPRED_PODOTCH'
      
        '  (CSID, PPID, PPID_TO, RPDATE, RPID, RPISDELETE, RPNOTE, RPSUMM' +
        'A, RPTIMEEDIT, '
      '   RPTIMEENTER, RPTYPE, RPUSEREDIT, RPUSERENTER)'
      'values'
      
        '  (:CSID, :PPID, :PPID_TO, :RPDATE, :RPID, :RPISDELETE, :RPNOTE,' +
        ' :RPSUMMA, '
      
        '   :RPTIMEEDIT, :RPTIMEENTER, :RPTYPE, :RPUSEREDIT, :RPUSERENTER' +
        ')')
    DeleteSQL.Strings = (
      'delete from RASPRED_PODOTCH'
      'where'
      '  RPID = :OLD_RPID')
    Left = 210
    Top = 382
  end
  object qPersonRaspr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 19'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1')
    GeneratorField.Field = 'RPID'
    Left = 176
    Top = 421
    object qPersonRasprSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qPersonRasprSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qPersonRasprSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qPersonRasprSDISDELETE: TIntegerField
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsPersonRaspr: TDataSource
    DataSet = qPersonRaspr
    Left = 144
    Top = 421
  end
  object qPoluchUslug: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND PS.SDID = 1246'
      'ORDER BY 2')
    Left = 336
    Top = 325
    object qPoluchUslugPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPoluchUslugPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPoluchUslugSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object dsPoluchUslug: TDataSource
    DataSet = qPoluchUslug
    Left = 296
    Top = 325
  end
  object dsUsluga: TDataSource
    DataSet = qUsluga
    Left = 296
    Top = 381
  end
  object qUsluga: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = dsPoluchUslug
    SQL.Strings = (
      
        'SELECT zapl.STNAME, zapl.SID , zapl.CTYPE, (zapl.summa_plat - CO' +
        'ALESCE(v_bank.sum_v_bank,0) - COALESCE(vozvr.sum_vozvr, 0)) AS d' +
        'ostupno, CAST ('#39'0'#39' AS INTEGER) AS zapl'
      'FROM'
      '('
      
        'SELECT S.SID, C.CTYPE, IIF(C.CTYPE = 2,'#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080#1077' '#1076 +
        #1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073#1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39', ST.STNAME) ' +
        'AS STNAME, SUM(C.CAMOUNT) AS summa_plat'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON C ON C.CSID = CS.CSID'
      'INNER JOIN SERVICES S ON S.SCID = C.SCID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'INNER JOIN USERS U ON U.PID = CS.CSUSERMONEY'
      'WHERE CS.PID_POLUCH = :PID'
      '    AND U.USNAME = CURRENT_USER'
      'GROUP BY 1,2,3'
      'HAVING SUM(C.CAMOUNT) > 0'
      ')  AS zapl'
      '--'#1082#1088#1086#1084#1077' '#1087#1077#1088#1077#1076#1072#1085#1085#1099#1093' '#1074' '#1073#1072#1085#1082
      'LEFT OUTER JOIN'
      '('
      'SELECT RPS.SID, SUM(RP.RPSUMMA) sum_v_bank'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN RP_SERVICES RPS ON RPS.RPID = RP.RPID'
      'WHERE RP.PPID_TO = 1'
      '    AND RP.RPISDELETE IS NULL'
      'GROUP BY 1'
      ') AS v_bank  ON v_bank.SID = zapl.SID'
      '--'#1082#1088#1086#1084#1077' '#1074#1086#1079#1074#1088#1072#1097#1077#1085#1085#1099#1093' '#1076#1077#1085#1077#1075' '#1088#1086#1076#1080#1090#1077#1083#1103#1084
      'LEFT OUTER JOIN'
      '('
      'SELECT RPS.SID, SUM(RP.RPSUMMA) sum_vozvr'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN RP_SERVICES RPS ON RPS.RPID = RP.RPID'
      'WHERE RP.PPID_TO = 2'
      '    AND RP.RPISDELETE IS NULL'
      'GROUP BY 1'
      ') AS vozvr ON vozvr.SID = zapl.SID'
      '')
    UpdateObject = quUsluga
    Left = 336
    Top = 381
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qUslugaSTNAME: TIBStringField
      FieldName = 'STNAME'
      ProviderFlags = []
      Size = 255
    end
    object qUslugaDOSTUPNO: TIBBCDField
      FieldName = 'DOSTUPNO'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      EditFormat = '0'
      Precision = 18
      Size = 2
    end
    object qUslugaSID: TIntegerField
      FieldName = 'SID'
      Origin = '"SERVICES"."SID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qUslugaZAPL: TIntegerField
      FieldName = 'ZAPL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      EditFormat = '0'
    end
    object qUslugaCTYPE: TIntegerField
      FieldName = 'CTYPE'
      ProviderFlags = []
    end
  end
  object dsPodotchLitso: TDataSource
    DataSet = qPodotchLitso
    Left = 144
    Top = 461
  end
  object qPodotchLitso: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      '--'#1095#1077#1083#1086#1074#1077#1082#1080
      
        'SELECT PP.PPID, P.PLASTNAME||'#39' '#39'||SUBSTRING(P.PNAME FROM 1 FOR 1' +
        ' )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')' +
        ' AS fio'
      'FROM  PERSON_PODOTCH PP'
      'INNER JOIN PEOPLE P ON P.PID = PP.PP_ID'
      'WHERE PP.PPTYPE = 1921 and PP.PP_ID <> :PID')
    GeneratorField.Field = 'RPID'
    Left = 176
    Top = 461
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qPodotchLitsoPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
  end
  object quUsluga: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  SID,'
      '  STNAME,'
      '  DOSTUPNO,'
      '  ZAPL'
      'from COMMON_SERV '
      'where'
      '  SID = :SID')
    ModifySQL.Strings = (
      'update COMMON_SERV'
      'set'
      '  DOSTUPNO = :DOSTUPNO,'
      '  SID = :SID,'
      '  STNAME = :STNAME,'
      '  ZAPL = :ZAPL'
      'where'
      '  SID = :OLD_SID')
    InsertSQL.Strings = (
      'insert into COMMON_SERV'
      '  (DOSTUPNO, SID, STNAME, ZAPL)'
      'values'
      '  (:DOSTUPNO, :SID, :STNAME, :ZAPL)')
    DeleteSQL.Strings = (
      'delete from COMMON_SERV'
      'where'
      '  SID = :OLD_SID')
    Left = 376
    Top = 385
  end
  object dsRPS: TDataSource
    DataSet = qRPS
    Left = 304
    Top = 565
  end
  object qRPS: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qRPSAfterInsert
    CachedUpdates = True
    SQL.Strings = (
      'SELECT RPS.*'
      'FROM RP_SERVICES RPS'
      'WHERE RPS.RPSID = -1')
    UpdateObject = quRPS
    GeneratorField.Field = 'RPSID'
    GeneratorField.Generator = 'GEN_RP_SERVICES_ID'
    Left = 344
    Top = 565
    object qRPSRPSID: TIntegerField
      FieldName = 'RPSID'
      Origin = '"RP_SERVICES"."RPSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRPSRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RP_SERVICES"."RPID"'
    end
    object qRPSSID: TIntegerField
      FieldName = 'SID'
      Origin = '"RP_SERVICES"."SID"'
    end
    object qRPSRPSSUMMA: TIBBCDField
      FieldName = 'RPSSUMMA'
      Origin = '"RP_SERVICES"."RPSSUMMA"'
      Precision = 18
      Size = 2
    end
    object qRPSRPSUSERENTER: TIBStringField
      FieldName = 'RPSUSERENTER'
      Origin = '"RP_SERVICES"."RPSUSERENTER"'
      Size = 40
    end
    object qRPSRPSTIMEENTER: TDateTimeField
      FieldName = 'RPSTIMEENTER'
      Origin = '"RP_SERVICES"."RPSTIMEENTER"'
    end
    object qRPSRPSUSEREDIT: TIBStringField
      FieldName = 'RPSUSEREDIT'
      Origin = '"RP_SERVICES"."RPSUSEREDIT"'
      Size = 40
    end
    object qRPSRPSTIMEEDIT: TDateTimeField
      FieldName = 'RPSTIMEEDIT'
      Origin = '"RP_SERVICES"."RPSTIMEEDIT"'
    end
    object qRPSCTYPE: TIntegerField
      FieldName = 'CTYPE'
      Origin = '"RP_SERVICES"."CTYPE"'
    end
  end
  object quRPS: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RPSID,'
      '  RPID,'
      '  SID,'
      '  RPSSUMMA,'
      '  RPSUSERENTER,'
      '  RPSTIMEENTER,'
      '  RPSUSEREDIT,'
      '  RPSTIMEEDIT,'
      '  CTYPE'
      'from RP_SERVICES '
      'where'
      '  RPSID = :RPSID')
    ModifySQL.Strings = (
      'update RP_SERVICES'
      'set'
      '  CTYPE = :CTYPE,'
      '  RPID = :RPID,'
      '  RPSID = :RPSID,'
      '  RPSSUMMA = :RPSSUMMA,'
      '  RPSTIMEEDIT = :RPSTIMEEDIT,'
      '  RPSTIMEENTER = :RPSTIMEENTER,'
      '  RPSUSEREDIT = :RPSUSEREDIT,'
      '  RPSUSERENTER = :RPSUSERENTER,'
      '  SID = :SID'
      'where'
      '  RPSID = :OLD_RPSID')
    InsertSQL.Strings = (
      'insert into RP_SERVICES'
      
        '  (CTYPE, RPID, RPSID, RPSSUMMA, RPSTIMEEDIT, RPSTIMEENTER, RPSU' +
        'SEREDIT, '
      '   RPSUSERENTER, SID)'
      'values'
      
        '  (:CTYPE, :RPID, :RPSID, :RPSSUMMA, :RPSTIMEEDIT, :RPSTIMEENTER' +
        ', :RPSUSEREDIT, '
      '   :RPSUSERENTER, :SID)')
    DeleteSQL.Strings = (
      'null;')
    Left = 384
    Top = 569
  end
end
